<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改车辆-信息')" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-info-edit" th:object="${carInfo}">
            <input name="carInfoId" th:field="*{carInfoId}" type="hidden">
            <input name="carId" th:field="*{carId}" type="hidden">
            <input name="menuId" th:field="*{menuId}" type="hidden">
            <input name="configType" th:field="*{configType}" type="hidden">
            <input id="car_info" name="info" th:field="*{info}" type="hidden">

            <div class="row clearfix">
                <div class="col-sm-2 column">
                    预览图片
                    <ul class="list-group" id="left_img_list"></ul>
                </div>
                <div class="col-sm-10 column">
                    <div class="row clearfix">
                        <div class="col-md-12 column">
                            <th:block class="form-group" th:if="${carInfo.carInfoId!=null}">
                                <label class="col-sm-1 control-label">图片</label>
                                <div class="col-sm-11" th:include="system/common/file_select :: multiple_img(_file_id='multipleFile',_img_list_id='left_img_list',_file_list=${@file.getFiles(carInfo.carId,carInfo.configType)})"/>
                            </th:block>
                        </div>
                    </div>

                    <div class="row clearfix" style='vertical-align: middle;text-align: center'>
                        <div class="form-group">
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'engine-compartment')">发动机舱</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'left-front-45')">左前45°</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'middle')">中间</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'right-front-45')">右前45°</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'ip-all')">IP整体照</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'ip-driving')">IP驾驶</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'ip-central-control')">IP中控</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'ip-co-pilot')">IP副驾</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'left-back-central-control-45')">左后45°中控</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'right-back-central-control-45')">右后45°中控</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'front-central-control')">中控前段</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'back-central-control')">中控后段</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'front-ceiling-view')">前顶棚视图</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'back-ceiling-view')">后顶棚视图</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'back-ceiling-view-detail')">前顶棚细节视图</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'sunroof-shade-view')">天窗遮阳帘视图</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'main-driver-door')">主驾驶门</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'main-driver-door-trim')">主驾驶门饰板</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'main-driver-door-window')">主驾驶门窗</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'passenger-driver-door-hinge')">副驾驶门</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'passenger-driver-door-trim')">副驾驶门饰板</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'passenger-driver-door-window')">副驾驶门窗</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'passenger-driver-door-hinge')">副驾驶铰链</span></h1></div>

                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'left-back-door')">左后门</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'left-back-door-trim')">左后门饰板</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'left-back-door-window')">左后门窗</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'left-back-door-hinge')">左后门铰链</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'right-back-door')">右后门</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'right-back-door-trim')">右后门饰板</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'right-back-door-window')">右后门窗</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'right-back-door-hinge')">右后门铰链</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'front-cover')">前盖</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'front-cover-soundproofing')">前盖隔音</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'back-cover')">后盖</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'back-cover-interior-panel')">后盖内饰板</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'left-driver-seat')">左侧主驾座椅</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'left-front-driver-seat-45')">左前45°主驾座椅</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'right-passenger-seat')">右侧副驾座椅</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'right-front-passenger-seat-45')">右前45°副驾座椅</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'left-rear-seat')">左侧后排座椅</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'left-front-rear-seat-45')">左前45°后排座椅</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'folding-rear-seat')">后排座椅折叠</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'trunk-space-1')">后备箱空间1</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'trunk-space-2')">后备箱空间2</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'trunk-carpet')">后备箱地毯</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'trunk-carpet-in')">后备箱地毯内</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'storage-box-1')">储物盒1</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'storage-box-2')">储物盒2</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'storage-box-3')">储物盒3</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'storage-box-4')">储物盒4</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'storage-box-5')">储物盒5</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'storage-box-6')">储物盒6</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'storage-box-7')">储物盒7</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'storage-box-8')">储物盒8</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'storage-box-9')">储物盒9</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'storage-box-10')">储物盒10</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'storage-box-11')">储物盒11</span></h1></div>
                            <div class="col-sm-2 column"><h1><span class="car_item label" th:onclick="multipleFile_manager.initImgList(this,[[${carInfo.carId}]],[[${carInfo.configType}]],'storage-box-12')">储物盒12</span></h1></div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">备注：</label>
                        <div class="col-sm-8">
                            <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"></label>
                        <div class="col-sm-8"><button type="button" class="btn btn-success" onclick="submitHandler()">上传</button></div>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <th:block th:include="include :: select2-js" />
    <th:block th:include="include :: bootstrap-select-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/car/info";
        $("#form-info-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                let json=$('#form-info-edit').serializeJson();
                console.log(json)
                $('#car_info').val(JSON.stringify(json.infoMap)||'{}');
                let serialize = $('#form-info-edit').serialize();
                console.log(serialize)
                // console.log(JSON.stringify($('#form-info-edit').serializeJson()))
                // return;
                $.operate.save(prefix + "/edit?_="+Math.random(), serialize);
            }
        }
        $(function (){
            multipleFile_manager.init({busId: [[${carInfo.carId}]], busType: [[${carInfo.configType}]], fileType: 'img'});
        });
    </script>
</body>
</html>